package com.enqualcomm.kids.mvp.chat;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.view.View;

/**
 * Created by yinzhiqun on 2015/10/17.
 */
public abstract class ViewController {
    protected Activity context;
    public ViewController(Activity context, int layoutId){
        this.context = context;
        context.setContentView(layoutId);
    }

    protected View findViewById(int id){
        return context.findViewById(id);
    }

    protected Intent getIntent(){
        return context.getIntent();
    }

    protected void finish(){
        context.finish();
    }

    protected Resources getResources(){
        return context.getResources();
    }

    protected String getString(int resId){
        return context.getString(resId);
    }

    protected void startService(Intent intent){
        context.startService(intent);
    }

    protected void startActivityForResult(Intent intent,int requestCode){
        context.startActivityForResult(intent, requestCode);
    }

    protected void startActivity(Intent intent){
        context.startActivity(intent);
    }

}